package com.ruanjian.eduservice.controller;

import com.ruanjian.commonUtils.R;
import com.ruanjian.eduservice.entity.EduTeacher;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@CrossOrigin
public class LoginConstroller2 {
//    if (res.status === 200) {
//        if (res.data.code === 0) {
//            let token = res.data.data.token
//            let role = res.data.data.role
//            this.$store.commit('$_setStorage', token);
//            this.$store.commit('$_setStorageRole',role);
//            ElMessage.success({
//                    message: '登录成功！',
//                    type: 'success'
//            });
//            if (role === 1){
//                this.redirect('teacher_user_center')
//            }
    @PostMapping("/web/login")
    public R login(@RequestBody(required = false) EduTeacher eduTeacher)
    {
        Map<String,Object> data=new HashMap<>();
        data.put("token","token");
        data.put("role",1);
        return R.ok().data("code", 0).data("data", data).data("role",1).data("pwd","pwd").data("token","token").Status("200");
    }
}
